// phalanx copy.hpp.cu header file

// Copyright (c) 2010 - 2011 Kohei Takahashi (Flast).
// Distributed under the MIT license. for more detail see COPYING.

// Redefinition C++03 copy algorithm

#ifndef IG_PHALANX_ALGORITHM_COPY_HPP_CU_ONCE_
#define IG_PHALANX_ALGORITHM_COPY_HPP_CU_ONCE_

#include <phalanx/config.hpp.cu>

#include <phalanx/utility/begin_end.hpp.cu>

namespace phalanx
{

template < typename InputIterator, typename OutputIterator >
PHALANX_CONFIG_DEFAULT_FUNCTION( false )
OutputIterator
copy( InputIterator first, const InputIterator last, OutputIterator result )
{
    for ( ; first != last; ++first, ++result )
    { *result = *first; }
    return result;
}

template < typename Container, typename OutputIterator >
PHALANX_CONFIG_DEFAULT_FUNCTION( false )
OutputIterator
copy( Container &cont, OutputIterator result )
{ return copy( begin( cont ), end( cont ), result ); }

template < typename Container, typename OutputIterator >
PHALANX_CONFIG_DEFAULT_FUNCTION( false )
OutputIterator
copy( const Container &cont, OutputIterator result )
{ return copy( begin( cont ), end( cont ), result ); }

} // namespace phalanx

#endif // IG_PHALANX_ALGORITHM_COPY_HPP_CU_ONCE_

